import Vue from 'vue';

import Vuex from 'vuex'

Vue.use(Vuex);

const state = {
  count : 0,
  price: 99,
}

const mutations= {
    increment(state){
        state.count++
    },
    incrementN(state,{n}) {
        state.count +=n;
    },
    decrement(state){
        state.count --
    },
    incrementWait(state) {
        setTimeout(() => {
          state.count++;
        }, 2000);
      },
}
export default new Vuex.Store({
    state,
    mutations
  });